1. Technical Field
The present disclosure relates to database systems and more specifically to offline validation of data in a database system for foreign key constraints.
2. Related Art
A database system generally enables data to be organized and managed in a structured manner. A common example of a database system is a relational database management system (RDBMS), in which data is organized in the form of one or more databases, tables and columns (containing the actual data values), and the data is managed (added/deleted/updated, etc.) in databases using structured queries (e.g., Structured Query Language) as is well known in the relevant arts.
Keys are fundamental to the organization of data in a database system. Thus, in the context of relational database systems, data is organized in the form of tables and a primary key (spanning one or more columns) uniquely identifies each row of a table. On the other hand, a foreign key identifies a column or a set of columns (foreign key column) in one (referencing) table that refers to a column or set of columns (primary/candidate key column) in another (referenced) table.
Constraints are often defined associated with a database system to restrict the type/format/uniqueness of the data values stored in specific columns in the database system. In particular, with respect to foreign keys noted above, the data values stored in a foreign key column of a table are to be restricted to the specific data values stored in the primary key column in another table. Such a constraint is referred to as a foreign key constraint.
Validation of data for foreign key constraints is commonly performed/enforced when data values are sought to be stored in the database system during normal operations (e.g., when processing transaction requests, etc). Such validations performed during normal operations may be termed as ‘online or real-time validation’, and generally operates to ensure that the data in the database system is maintained in a consistent form, including enforcement of the foreign key constraints (according to the design/definition of the database system).
There is often a need for offline validation of data for foreign key constraints. Offline validation refers to validation of data already stored in a database system. Offline validation may be desirable, for example, in scenarios where the database system is required to be populated with large amount of data (e.g., when migrating, upgrading or importing) without enforcements of the constraints during the population/storage process (to reduce the time/resources requirements). Accordingly, it may be desirable that the populated data be validated offline/later to ensure that the data is consistent for subsequent normal operation of the database system.
Several aspects of the present invention provide for offline validation of data in a database system for foreign key constraints, as described below with examples.
In the drawings, like reference numbers generally indicate identical, functionally similar, and/or structurally similar elements. The drawing in which an element first appears is indicated by the leftmost digit(s) in the corresponding reference number.